-
-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement/ripple #3882
enhancement/ripple #3882
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #3882 +/- ##
=========================================
- Coverage 86.84% 86.6% -0.24%
=========================================
Files 160 158 -2
Lines 4249 4017 -232
Branches 1350 1271 -79
=========================================
- Hits 3690 3479 -211
+ Misses 449 436 -13
+ Partials 110 102 -8
Continue to review full report at Codecov.
|
src/components/VBtn/VBtn.js
Outdated
computedRipple () { | ||
const defaultRipple = this.icon || this.fab ? { circle: true } : true | ||
if (this.disabled) return false | ||
else return this.ripple || defaultRipple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if I do :ripple="false"
?
to allow for circle: true option when using icon prop
src/directives/ripple.ts
Outdated
@@ -15,13 +19,39 @@ declare global { | |||
enabled?: boolean | |||
centered?: boolean | |||
class?: string | |||
circle?: boolean | |||
} | |||
} | |||
} | |||
|
|||
interface RippleOptions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either export this or move it to types/*.d.ts
src/components/VBtn/VBtn.ts
Outdated
@@ -85,6 +85,11 @@ const VBtn = mixins( | |||
return (!this.outline && !this.flat) | |||
? this.addBackgroundColorClassChecks(classes) | |||
: this.addTextColorClassChecks(classes) | |||
}, | |||
computedRipple (): any { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This returns RippleOptions | boolean
, try to avoid using any
where possible.
src/components/VBtn/VBtn.ts
Outdated
@@ -41,7 +41,7 @@ const VBtn = mixins( | |||
outline: Boolean, | |||
ripple: { | |||
type: [Boolean, Object], | |||
default: true | |||
default: null | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...
} as PropValidator<RippleOptions | boolean | null>
src/mixins/routable.ts
Outdated
@@ -26,6 +26,12 @@ export default Vue.extend({ | |||
target: String | |||
}, | |||
|
|||
computed: { | |||
computedRipple (): any { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
src/mixins/routable.ts
Outdated
value: (this.ripple && !this.disabled) ? this.ripple : false | ||
}] as any, // TODO | ||
value: this.computedRipple | ||
}] as any, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have left a better comment, the TODO is to remove as any
when vuejs/vue#8013 is fixed
Are we still doing this? Last time I checked it broke radios and checkboxes. |
I'll have a look |
Closing due to inactivity. |
Description
Updated ripple effect to hopefully more closely resemble material design ripple.
I was unable to find a good single solution for both rectangular and circular ripples, so I've added a
circle
option to the ripple directive. Someone smarter than me might have a better solution?Motivation and Context
because
How Has This Been Tested?
with provided markup
Markup:
Types of changes
Checklist:
master
for bug fixes,dev
for new features and breaking changes).